Skip to content

Conversation

@mcbarton
Copy link
Collaborator

Description

Please include a summary of changes, motivation and context for this PR.

This PR updates CppInterOps Emscripten workflows to emsdk version 4.0.9 . With these changes locally CppInterOps Emscripten build passed all tests, but works is needed in xeus-cpp before this PR will be ready to go in.

name: CppInterOp-wasm
channels:
- https://prefix.dev/emscripten-forge-dev
- https://prefix.dev/emscripten-forge-4x
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change has to be made until Emscripten forges emsdk 4x branch is merged into its main.

std::vector<Decl*> Decls;
std::string code = "int f1(int i) { return i * i; }";
std::vector<const char*> interpreter_args = {"-include", "new"};
std::vector<const char*> interpreter_args = {"-include", "new", "-Xclang", "-iwithsysroot/include/compat"};
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given these extra flags are only needed for the Emscripten case, it might be worth making the args dependent on what platform we are targeting. Same for the other test.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

if (llvm::sys::RunningOnValgrind())
GTEST_SKIP() << "XFAIL due to Valgrind report";
std::vector<const char*> interpreter_args = { "-include", "new" };
std::vector<const char*> interpreter_args = { "-include", "new", "-Xclang", "-iwithsysroot/include/compat" };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "std::vector" is directly included [misc-include-cleaner]

unittests/CppInterOp/InterpreterTest.cpp:2:

+ #include <vector>

@codecov
Copy link

codecov bot commented Nov 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.04%. Comparing base (2df83a9) to head (65b6b86).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #753   +/-   ##
=======================================
  Coverage   79.04%   79.04%           
=======================================
  Files           9        9           
  Lines        3879     3879           
=======================================
  Hits         3066     3066           
  Misses        813      813           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mcbarton
Copy link
Collaborator Author

Its not clear why googletest fails to build in the Emscripten ci with this change (see https://github.com/compiler-research/CppInterOp/actions/runs/19363850250/job/55410413357?pr=753#step:9:310). This error doesn't happen locally for me. I will debug (probably next week).

@mcbarton
Copy link
Collaborator Author

Its not clear why googletest fails to build in the Emscripten ci with this change (see https://github.com/compiler-research/CppInterOp/actions/runs/19363850250/job/55410413357?pr=753#step:9:310). This error doesn't happen locally for me. I will debug (probably next week).

It fails in the ci but not locally as the googletest in the ci is built with warnings treated as errors. Here is the warning I need to fix when googletest is being built https://github.com/compiler-research/CppInterOp/actions/runs/19366708961/job/55411697302?pr=753#step:9:363 .

@mcbarton mcbarton force-pushed the Update-emsdk-used-to-version-4.0.9 branch from 62c3987 to 55c39dc Compare November 14, 2025 16:49
Comment on lines 37 to 38
GIT_SHALLOW FALSE
GIT_TAG fa8438ae6b70c57010177de47a9f13d7041a6328
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seemingly random change is a workaround for this bug in Googletest google/googletest#4762 . I got this workaround looking at what others had done to workaround the bug. We are basically fixed to a commit after v1.17 until v1.18 comes out.

@mcbarton
Copy link
Collaborator Author

mcbarton commented Nov 19, 2025

Things to do as part of this PR

  • Change emsdk to 4.0.18 . I didn't notice Emscripten forges emsdk version in its 4x branch had been changed to 4.0.18
  • Check whether any of the Emscripten tests which are currently skipped pass with this updated emsdk.
  • Revert https://prefix.dev/emscripten-forge-4x change before PR goes in, as changes should be in Emscripten forges main branch at that point.

@mcbarton mcbarton force-pushed the Update-emsdk-used-to-version-4.0.9 branch from bec1d8c to 4954c8e Compare November 20, 2025 19:46
@mcbarton mcbarton changed the title Update emsdk used to 4.0.9 Update emsdk used to 4.0.18 Nov 20, 2025
@anutosh491
Copy link
Collaborator

Hi,

just making a note that emscripten-forge's 4-x branch is experimental and subject to version change in the near future.

// "float", "double", "long double", "void"}

std::vector<const char*> interpreter_args = { "-include", "new" };
std::vector<const char*> interpreter_args = { "-include", "new", "-Xclang", "-iwithsysroot/include/compat" };
Copy link
Collaborator Author

@mcbarton mcbarton Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interestingly this wasn't needed for 4.0.9, but was needed for 4.0.18 even though it appears to be fixing the same problem of xlocale.h not being found for the other tests which needed it for 4.0.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants